//
//  UIHelper.h
//  PurchasingMeeting
//
//  Created by zhuang yihang on 7/11/13.
//  Copyright (c) 2013 YX. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface UIHelper : NSObject

+ (UIHelper *)getInstance;

//------------------------------------------------------------------------------------------------------
- (UIImage *)getBundleImage:(NSString *)fileName;

//------------------------------------------------------------------------------------------------------
- (UIColor *)getRandomColor;
- (UIColor *)getColorbyRed:(int)red Green:(int)green Blue:(int)blue Alpha:(int)alpha;

//------------------------------------------------------------------------------------------------------
//创建一个与image大小相同的按钮
- (UIButton *)createButtonByImage:(UIImage *)image;
//从bundle里面读取filename图片，创建与图片大小的按钮
- (UIButton *)createButtonByImageName:(NSString *)fileName;
//从path里面读取filename图片，创建与图片大小的按钮
- (UIButton *)createButtonByImagePath:(NSString *)filePath;

//创建一个frame大小的UIButton
- (UIButton *)createButtonByFrame:(CGRect)frame;

//设置按钮的图片和文字竖直排列
- (void)setButtonVerticalArrange:(UIButton *)button;

//------------------------------------------------------------------------------------------------------
//创建一个与image大小相同的UIImageView
- (UIImageView *)createViewByImage:(UIImage *)image;
//从bundle里面读取filename图片，创建与图片大小的UIImageView
- (UIImageView *)createViewByImageName:(NSString *)fileName;
//从path里面读取filename图片，创建与图片大小的UIImageView
- (UIImageView *)createViewByImagePath:(NSString *)filePath;

//------------------------------------------------------------------------------------------------------
//创建固定宽度，高度根据content自适应的label
- (UILabel *)createLabel:(NSString *)content withWidth:(float)width withFont:(UIFont *)font;
//根据frame，创建label
- (UILabel *)createLabel:(CGRect)frame;

//------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------

@end
